class LoginEntity {
  Data? data;
  int? errorCode;
  String? errorMsg;

  LoginEntity({this.data, this.errorCode, this.errorMsg});

  LoginEntity.fromJson(Map<String, dynamic> json) {
    if (json["data"] is Map)
      this.data = json["data"] == null ? null : Data.fromJson(json["data"]);
    if (json["errorCode"] is int) this.errorCode = json["errorCode"];
    if (json["errorMsg"] is String) this.errorMsg = json["errorMsg"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) data["data"] = this.data?.toJson();
    data["errorCode"] = this.errorCode;
    data["errorMsg"] = this.errorMsg;
    return data;
  }
}

class Data {
  bool? admin;
  List<dynamic>? chapterTops;
  int? coinCount;
  List<dynamic>? collectIds;
  String? email;
  String? icon;
  int? id;
  String? nickname;
  String? password;
  String? publicName;
  String? token;
  int? type;
  String? username;

  Data(
      {this.admin,
      this.chapterTops,
      this.coinCount,
      this.collectIds,
      this.email,
      this.icon,
      this.id,
      this.nickname,
      this.password,
      this.publicName,
      this.token,
      this.type,
      this.username});

  Data.fromJson(Map<String, dynamic> json) {
    if (json["admin"] is bool) this.admin = json["admin"];
    if (json["chapterTops"] is List)
      this.chapterTops = json["chapterTops"] ?? [];
    if (json["coinCount"] is int) this.coinCount = json["coinCount"];
    if (json["collectIds"] is List) this.collectIds = json["collectIds"] ?? [];
    if (json["email"] is String) this.email = json["email"];
    if (json["icon"] is String) this.icon = json["icon"];
    if (json["id"] is int) this.id = json["id"];
    if (json["nickname"] is String) this.nickname = json["nickname"];
    if (json["password"] is String) this.password = json["password"];
    if (json["publicName"] is String) this.publicName = json["publicName"];
    if (json["token"] is String) this.token = json["token"];
    if (json["type"] is int) this.type = json["type"];
    if (json["username"] is String) this.username = json["username"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data["admin"] = this.admin;
    if (this.chapterTops != null) data["chapterTops"] = this.chapterTops;
    data["coinCount"] = this.coinCount;
    if (this.collectIds != null) data["collectIds"] = this.collectIds;
    data["email"] = this.email;
    data["icon"] = this.icon;
    data["id"] = this.id;
    data["nickname"] = this.nickname;
    data["password"] = this.password;
    data["publicName"] = this.publicName;
    data["token"] = this.token;
    data["type"] = this.type;
    data["username"] = this.username;
    return data;
  }
}
